import time
from public.action import *
from public.business import *
from public.testData import *
from public.tools import*
testCase="DBshop007_订单管理发货单"
firefox=openBrowser(urlAdmin) #调用函数打开网址
DBshopLoginAdmin(firefox)
# 2.进入订单管理界面
DBshopEnterMenu2(firefox,'销售管理','发货单')
# 点击查看
# firefox.find_elements_by_xpath('//td[contains(.,"%s")]/following-sibling::td[5]/a'%num).click()
firefox.find_elements_by_link_text("查看")[0].click()

try:
    firefox.find_element_by_xpath("//span[@class='text-success']")
    time.sleep(5)
    i=firefox.find_element_by_xpath("//span[@class='text-success']").text
    writeLog(testCase+"测试通过,状态为" + str(i))
    print(i)
except:
    writeLog("%s 测试失败" % testCase)
    getPhoto(firefox)
firefox.quit() #quit()函数有2个作用 1.关闭所有页面 2.关闭浏览器对象 quit()函数建议放到脚本的最后